@echo off
:checkNet
ping 192.168.11.174 -n 1 -w 1000 >nul
if errorlevel 1 (
    echo net error
    :: 等待1秒
    ping -n 2 127.0.0.1 > nul
    goto checkNet
)
echo net ok
set PROC_NAME=wxbot-sidecar.exe
set SCRIPT_NAME=%cd%\wx.py
set PYTHON_EXE=%cd%\python\python.exe
set CONFIG_FILE=%cd%\bin\wxbot.json
@REM echo %PROC_NAME%
start %PYTHON_EXE% %SCRIPT_NAME%
tasklist | find /i "%PROC_NAME%" >nul
if errorlevel 1 (
    echo starting...
    start %cd%\bin\wxbot-sidecar.exe -w -b -c %CONFIG_FILE%
) else (
    echo aleady running
)
